home *** CD-ROM | disk | FTP | other *** search
/ How Many Bugs in a Box / How Many Bugs in a Box.cdr / bugs / act4 / 00083.ls < prev    next >
Encoding:
Text File  |  1995-04-05  |  7.5 KB  |  173 lines

  1. on oldidle
  2.   global mycolor, kingcolor, splotx, sploty
  3.   if the machineType < 256 then
  4.     exit
  5.   end if
  6.   if mycolor > 0 then
  7.     set splotx to the mouseH
  8.     set sploty to the mouseV
  9.     set the locH of sprite 48 to splotx
  10.     set the locV of sprite 48 to sploty
  11.     updateStage()
  12.     cursor(200)
  13.   end if
  14. end
  15.  
  16. on setcolor snum, col
  17.   global colpal, BugColorKey, BugColors, pal
  18.   if col = 0 then
  19.     set newcolor to 0
  20.   else
  21.     set newcolor to getAt(colpal, col)
  22.   end if
  23.   if (col < 11) and ((snum > 13) and (snum < 37)) then
  24.     if col = 0 then
  25.       setAt(BugColors, snum - 13, 0)
  26.     else
  27.       set xx to getPos(pal, col)
  28.       set correctcol to getAt(BugColorKey, snum - 13)
  29.       if not (getAt(BugColors, snum - 13) = 1) then
  30.         if not (correctcol = xx) then
  31.           setAt(BugColors, snum - 13, 2)
  32.         else
  33.           setAt(BugColors, snum - 13, 1)
  34.         end if
  35.       else
  36.         set newcolor to getAt(colpal, getAt(pal, correctcol))
  37.       end if
  38.     end if
  39.   end if
  40.   set the ink of sprite snum to 8
  41.   set the foreColor of sprite snum to newcolor
  42.   set the backColor of sprite snum to newcolor
  43.   if col <> 11 then
  44.     updateStage()
  45.   end if
  46. end
  47.  
  48. on startMovie
  49.   global gamefourlevel, colpal, level1, book, template, tinc, buglist, bucketcol, NumofCol, ChipList, NameList, masterlist, correctanim, wronganim, waittime, introplayed, cansounds, canclicked, mycolor, colorcrsr
  50.   set mycolor to 0
  51.   set introplayed to 0
  52.   setmaster()
  53.   set waittime to 4
  54.   set bucketcol to []
  55.   set ChipList to []
  56.   set NameList to []
  57.   set cansounds to []
  58.   repeat with xxx = 1 to 10
  59.     add(ChipList, the number of cast ("chip" & xxx))
  60.     add(NameList, the number of cast ("co" & xxx))
  61.     add(cansounds, "can" & xxx & "sound")
  62.   end repeat
  63.   if gamefourlevel = 0 then
  64.     set gamefourlevel to 1
  65.   end if
  66.   if not (the machineType = 256) and not objectp(colorcrsr) then
  67.     set colorcrsr to colorcursor(mnew)
  68.   end if
  69.   if the machineType = 256 then
  70.     cursor([the number of cast "cursing", the number of cast "cursing mask"])
  71.   end if
  72.   set correctanim to [1, 2, 3, 4]
  73.   set buglist to [1, 2, 3, 4, 5, 6, 7, 8, 9]
  74.   if level1 = 1 then
  75.     set wronganim to [1, 2, 3, 4]
  76.   else
  77.     set wronganim to [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
  78.   end if
  79.   set canclicked to [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
  80.   set tinc to 1
  81.   set template to 254
  82.   set book to 1
  83.   set level1 to gamefourlevel
  84.   set stemp to the text of cast "colpal"
  85.   set colpal to []
  86.   repeat with xxx = 1 to the number of items in stemp
  87.     add(colpal, value(item xxx of stemp))
  88.   end repeat
  89. end
  90.  
  91. on stopMovie
  92.   global colorcrsr
  93.   if not (the machineType = 256) and objectp(colorcrsr) then
  94.     colorcrsr(mReleaseCursor)
  95.     if objectp(colorcrsr) then
  96.       colorcrsr(mdispose)
  97.     end if
  98.   end if
  99.   repeat with xxx = 1 to 48
  100.     set the visible of sprite xxx to 1
  101.   end repeat
  102. end
  103.  
  104. on setbug param
  105.   global book, mycolor, level1
  106.   puppetSprite(1, 1)
  107.   puppetSprite(12, 1)
  108.   set mycolor to 0
  109.   set book to param
  110.   unpuppetall()
  111.   if level1 > 4 then
  112.     go("level 3")
  113.   else
  114.     go("main")
  115.   end if
  116. end
  117.  
  118. on setlevel param
  119.   global level1, mycolor
  120.   puppetSprite(1, 1)
  121.   puppetSprite(12, 1)
  122.   set mycolor to 0
  123.   set level1 to param + 2
  124.   unpuppetall()
  125.   if level1 > 4 then
  126.     go("level 3")
  127.   else
  128.     go("main")
  129.   end if
  130. end
  131.  
  132. on unpuppetall
  133.   repeat with xxx = 1 to 48
  134.     puppetSprite(xxx, 0)
  135.   end repeat
  136. end
  137.  
  138. on checkcolor spritenum, colornum
  139.   global BugColors, pal
  140.   set dcolor to getPos(pal, colornum)
  141.   set colorstatus to getAt(BugColors, spritenum - 13)
  142.   return colorstatus
  143. end
  144.  
  145. on IsPictFinished
  146.   global BugColors
  147.   set ColSize to count(BugColors)
  148.   set total to 1
  149.   repeat with xxx = 1 to ColSize
  150.     set total to total * getAt(BugColors, xxx)
  151.   end repeat
  152.   return total
  153. end
  154.  
  155. on resetgame
  156.   global cursorset, colorcrsr
  157.   if not (the machineType = 256) and objectp(colorcrsr) then
  158.     colorcrsr(mReleaseCursor)
  159.     colorcrsr(mdispose)
  160.     cursor(4)
  161.     cursor(-1)
  162.     set colorcrsr to colorcursor(mnew)
  163.   end if
  164.   set cursorset to 0
  165. end
  166.  
  167. on setmaster
  168.   global masterlist, mastercounter
  169.   set masterlist to [[[505, 0, 0], [506, 0, 0], [507, 0, 0], [508, 0, 0], [508, 0, 0], [509, 0, 0], [510, 0, 0], [511, 0, 0]], [[512, 0, 0], [513, 0, 0], [514, 0, 0], [515, 0, 0], [516, 1, 0]], [[517, 0, 0], [518, 1, 1], [519, 1, 0], [518, 1, 1], [519, 1, 0]], [[520, 0, 0], [521, 0, 0], [522, 0, 0], [523, 0, 0], [524, -1, 0], [524, -1, 0], [523, 0, 0], [522, 0, 0], [521, 0, 0], [520, 0, 0]], [[525, 0, 0], [526, 6, 3], [527, 24, 10], [526, 6, 3], [525, 0, 0], [528, -11, 2], [529, -28, 7]], [[530, 0, 0], [532, -1, -28], [533, -1, -28], [534, -1, -28], [531, -1, -28], [532, -1, -28], [533, -1, -28], [534, -1, -28], [531, -1, -28], [532, -1, -28], [533, -1, -28], [534, -1, -28], [531, -1, -28], [532, -1, -28], [533, -1, -28], [534, -1, -28], [530, 0, 0], [530, 0, 0]], [[535, 0, 0], [536, 0, 1], [537, 1, 3], [536, 0, 1], [535, 0, 0], [536, 0, 1], [537, 1, 3], [536, 0, 1], [535, 0, 0], [536, 0, 1], [537, 1, 3], [536, 0, 1], [535, 0, 0]], [[538, 0, 0], [539, 1, 0], [539, 1, 0], [538, 0, 0], [539, 1, 0], [539, 1, 0], [538, 0, 0], [539, 1, 0], [539, 1, 0]], [[542, 0, 0], [541, -2, 1], [543, 1, 0], [541, -2, 1]], [[544, 0, 0], [545, 1, 1], [544, 0, 0], [545, 1, 1], [544, 0, 0], [545, 1, 1]], [[546, 0, 0], [547, 0, 0], [548, 0, 1], [549, 0, 1], [550, 0, 1], [551, 0, 1], [552, 0, 1], [547, 0, 0], [548, 0, 1], [549, 0, 1], [550, 0, 1], [551, 0, 1], [552, 0, 1]], [[553, 0, 0], [554, 0, 0], [555, 0, 0], [556, 0, 0], [557, 0, 0], [553, 0, 0], [554, 0, 0], [555, 0, 0], [556, 0, 0], [557, 0, 0], [553, 0, 0]], [[558, 0, 0], [559, 1, 0], [560, 0, 0], [559, 1, 0], [560, 0, 0], [559, 1, 0], [560, 0, 0], [559, 1, 0], [560, 0, 0]], [[561, 0, 0], [562, 0, 0], [563, 0, 0], [564, 0, 0], [565, 0, 0], [564, 0, 0], [563, 0, 0], [562, 0, 0], [561, 0, 0], [561, 0, 0], [562, 0, 0], [563, 0, 0], [564, 0, 0], [565, 0, 0], [565, 0, 0], [565, 0, 0], [565, 0, 0], [565, 0, 0]], [[566, 0, 0], [567, 8, 3], [568, 17, 7], [568, 17, 7], [567, 8, 3], [566, 0, 0], [569, -11, 3], [570, -24, 6], [569, -11, 3], [566, 0, 0], [567, 8, 3], [568, 17, 7], [568, 17, 7], [567, 8, 3]], [[571, 0, 0], [573, 0, -19], [574, 0, -19], [575, 0, -19], [572, 0, -19], [573, 0, -19], [574, 0, -19], [575, 0, -19], [572, 0, -19], [573, 0, -19], [574, 0, -19], [575, 0, -19], [572, 0, -19]], [[576, 0, 0], [577, 0, 1], [578, 1, 0], [577, 0, 1], [576, 0, 0], [577, 0, 1], [578, 1, 0], [577, 0, 1], [576, 0, 0], [577, 0, 1], [578, 1, 0], [577, 0, 1], [576, 0, 0], [577, 0, 1], [578, 1, 0], [577, 0, 1], [576, 0, 0]], [[579, 0, 0], [580, 0, -2], [581, 1, -1], [581, 1, -1], [580, 0, -2]], [[582, 0, 0], [584, 1, -18], [583, 0, -19], [585, 1, -18], [583, 0, -19]], [[586, 0, 0], [587, -1, 1], [588, -1, 3], [587, -1, 1], [586, 0, 0], [587, -1, 1], [588, -1, 3], [587, -1, 1], [586, 0, 0], [587, -1, 1], [588, -1, 3], [587, -1, 1], [586, 0, 0]], [[590, 0, 0], [590, 0, 0], [591, 0, 0], [591, 0, 0], [592, 0, -3], [592, 0, -3], [593, 0, -4], [593, 0, -4], [589, 0, 0]], [[589, 0, 0], [589, 0, 0]], [[594, 0, 0], [594, 0, 0], [595, 0, 3], [595, 0, 3]], [[596, 0, 0], [596, 0, 0], [597, 0, 0], [597, 0, 0], [596, 0, 0], [596, 0, 0], [597, 0, 0], [597, 0, 0], [596, 0, 0], [596, 0, 0], [597, 0, 0], [597, 0, 0], [596, 0, 0], [596, 0, 0]], [[598, 0, 0], [598, 0, 0], [599, 0, 0], [599, 0, 0], [600, 0, 0], [600, 0, 0], [600, 0, 0], [600, 0, 0], [601, 0, 0], [601, 0, 0]], [[602, 0, 0], [602, 0, 0], [603, 0, 0], [603, 0, 0], [604, 0, 0], [604, 0, 0], [603, 0, 0], [603, 0, 0], [602, 0, 0], [602, 0, 0]]]
  170.   set mastercounter to [8, 5, 5, 10, 7, 18, 13, 9, 4, 6, 13, 11, 9, 18, 14, 13, 17, 5, 5, 13, 9, 2, 4, 14, 10, 10]
  171.   preLoadCast(505, 588)
  172. end
  173.